package com.zhuss.common;

import org.springframework.beans.factory.annotation.Autowired;

import com.zhuss.db.dao.ext.OpLogDao;
import com.zhuss.db.entity.OpLog;
import com.zhuss.enums.EnumUtil;
import com.zhuss.enums.LogActionEnum;
import com.zhuss.enums.MoudleEnum;


public abstract class AbstractProcessor<Result, Param> implements Processor<Result, Param> {
	
	@Autowired
	private OpLogDao opLogDao;
	
	@Override
	public void log(OpLog record) {
		System.out.println();
		record.setContent("模块: " + EnumUtil.containsKey(MoudleEnum.class, record.getMoudle()) + ", " +
				"操作: " + EnumUtil.containsKey(LogActionEnum.class, record.getAction()) + ", " + record.getContent());
		opLogDao.insertSelective(record);
	}
	
	/*@Override
	public void check(Param param) throws AabException {
		System.out.println(param);
	}*/


}
